from langfuse.decorators import observe, langfuse_context
from langfuse.openai import openai # OpenAI integration
from dotenv import load_dotenv, find_dotenv

_ = load_dotenv(find_dotenv())

@observe(name="hello")
def run():
    return openai.chat.completions.create(
        model="gpt-4o",
        messages=[
          {"role": "user", "content": "对我说Hello, World!"}
        ],
    ).choices[0].message.content
 
print(run())
langfuse_context.flush()